find all occurrences of a substring in a string c